
<!doctype html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
    <meta name="description" content="">
    <meta name="author" content="Mark Otto, Jacob Thornton, and Bootstrap contributors">
    <meta name="generator" content="Jekyll v3.8.6">
    <title>lingkong-robot</title>



    <!-- Bootstrap core CSS -->
<link href="{{static_url('bootstrap.min.css')}}" rel="stylesheet" integrity="sha384-Vkoo8x4CGsO3+Hhxv8T/Q5PaXtkKtu6ug5TOeNV6gBiFeWPGFN9MuhOf23Q9Ifjh" crossorigin="anonymous">
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.8.1/css/all.css">

    <style>
      .bd-placeholder-img {
        font-size: 1.125rem;
        text-anchor: middle;
        -webkit-user-select: none;
        -moz-user-select: none;
        -ms-user-select: none;
        user-select: none;
      }

      @media (min-width: 768px) {
        .bd-placeholder-img-lg {
          font-size: 3.5rem;
        }
      }
    </style>

    <!-- Custom styles for this template -->
    <link href="{{static_url('dashboard.css')}}" rel="stylesheet">
    <link href="{{static_url('starter-template.css')}}" rel="stylesheet">
    <link href="{{static_url('bubble.css')}}" rel="stylesheet">
  </head>
  <body>
    <nav class="navbar navbar-dark fixed-top bg-dark flex-md-nowrap p-0 shadow">
  <a class="navbar-brand col-sm-3 col-md-2 mr-0" href="#">lingkong-robot</a>
</nav>

<div class="container-fluid">
  <div class="row">
    <nav class="col-md-2 d-none d-md-block bg-light sidebar">
      <div class="sidebar-sticky">

        <ul class="nav flex-column">

          <li class="nav-item">
            <a class="nav-link" href="/">
              <span data-feather="home"></span>
              介绍
            </a>
          </li>
          <li class="nav-item">
            <a class="nav-link" href="/log">
              <span data-feather="file"></span>
              日志
            </a>
          </li>
          <li class="nav-item">
            <a class="nav-link" href="/study">
              <span data-feather="users"></span>
              修改配置项教程
            </a>
          </li>
          <li class="nav-item">
            <a class="nav-link" href="/ds">
              <span data-feather="shopping-cart"></span>
              打赏
            </a>
          </li>
        </ul>

        <h6 class="sidebar-heading d-flex justify-content-between align-items-center px-3 mt-4 mb-1 text-muted">
          <span>功能</span>
          <a class="d-flex align-items-center text-muted" href="#" aria-label="Add a new report"></a>
        </h6>

        <ul class="nav flex-column mb-2">

          <li class="nav-item">
            <a class="nav-link active" href="/dh">
              <span data-feather="bar-chart-2"></span>
              对话 <span class="sr-only">(current)</span>
            </a>
          </li>

          <li class="nav-item">
            <a class="nav-link" href="/list">
              <span data-feather="file-text"></span>
              清单
            </a>
          </li>
        </ul>

      </div>
    </nav>

    <main role="main" class="col-md-9 ml-sm-auto col-lg-10 px-4">
      <div class="container">
        <h1 class="mt-5">对话</h1>
        <p class="lead">你可以通过以下窗口和灵空文字对话哦！</p>
        <div class="container history" id="container">

          {% if not history or len(history) == 0 %}
            <center>
              <p>现在暂时还没有聊天记录哦！请和灵空聊几句吧！</p>
            </center>
          {% else %}
            {% for h in history %}
              {% if h['type'] == 0 %}
                {% comment 用户 %}
                <div class="right">
                  <div class="bubble bubble-green">
                    <div class="bubble-avatar"><i class="fas fa-user"></i></div>
                    <p style="text-align: left" id="{{ h['uuid']}}">{{ h['text'] }}</p>
                  </div>
                </div>
              {% else %}
                {% comment 机器人 %}
                <div class="left">
                  <div class="bubble bubble-white">
                    <div class="bubble-avatar"><image src="{{static_url('lingkong.png')}}" width="80px"></image></div>
                    <p style="text-align: left" id="{{ h['uuid']}}">{{ h['text'] }}</p>
                  </div>
                </div>
              {% end %}
            {% end %}
          {% end %}

        </div>

        <br/>

        <div class="from-online">
          <center>

            <form class="form-row" action="#">
              <label for="query" class="col-from-label"></label>
              <div class="col">
                <input type="text" class="form-control" id="query" placeholder="在这输入话以和灵空聊天，你可以说：你好啊、今天天气怎么样、讲个笑话......"">
              </div>
              &nbsp;
              <button type="submit" class="btn btn-primary mb-2 CHAT"><i class="fas fa-comment"></i>发送</button>
            </form>

          </center>
        </div>

        <p class="mt-5 mb-3 text-muted">&copy; 灵空 2019-2020</p>
      </div>
    </main>
  </div>
</div>
<script src="{{static_url('jquery-3.4.1.min.js')}}" integrity="sha384-J6qa4849blE2+poT4WnyKhv5vZF5SrPo0iEjwBvKU7imGFAV0wwj1yYfoRSJoZ+n" crossorigin="anonymous"></script>
<script>window.jQuery || document.write('<script src="https://code.jquery.com/jquery-3.4.1.min.js"><\/script>')</script><script src="{{static_url('bootstrap.bundle.min.js')}}" integrity="sha384-6khuMg9gaYr5AxOqhkVIODVIvm9ynTT5J4V1cfthmT+emCG6yVmEZsRHdxlotUnm" crossorigin="anonymous"></script>
        <script src="{{static_url('feather.min.js')}}"></script>
        <script src="{{static_url('Chart.min.js')}}"></script>
        <script src="{{static_url('dashboard.js')}}"></script>
        <script src="{{static_url('index.js')}}" crossorigin="anonymous"></script>
      </body>
</html>